<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>SEO渠道</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <link rel="stylesheet" href="./css/style.css">
    <style>
        .sl {
            background-color: #eee!important;
            color: #666!important;
            width: 180px !important;
        }
        
        .layui-form-item {
            margin-bottom: 0px;
        }
        
        input[type='text'][disabled] {
            background-color: #eee!important;
            border: none;
            color: black;
        }
    </style>
</head>

<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">渠道管理</a>
        <a>
          <cite>SEO渠道</cite></a>
      </span>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
            <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>

    <div class="x-body relative ">
        <div class="layui-row">
            <form class="layui-form layui-col-md12 x-so">
                <input type="text" name="username" placeholder="请输入网站名或网址查询" autocomplete="off" class="layui-input">
                <button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
            </form>

        </div>
        <xblock>
            <button class="layui-btn left" onclick="x_admin_show('新增SEO渠道信息','./SEO-add.html',600,400)"><i class="layui-icon"></i>新增渠道</button>

            <div class=" charge">
                <span class="fz0">当前负责人：</span><span class="fz1">产品部</span> <span class="fz2">郭富城</span>
                <div class="left seo-q none">
                    <form action="" class="layui-form layui-form-pane left">
                        <div class="layui-form-item">
                            <label for="username" class="layui-form-label">
                            修改负责人
                        </label>
                            <div class="layui-input-inline">
                                <select id="department" name="department" class="valid" lay-filter="province">
                                <option value=""></option>
                                <option value="22">策划</option>
                                <option value="33">销售</option>
                                <option value="44">11</option>
                                <option value="55">44</option>
                                <option value="66">444</option>
                                <option value="77">888</option>
                            </select>
                            </div>
                            <div class="layui-input-inline peopleDown">
                                <select id="people" name="people" class="valid">

                            </select>
                            </div>
                        </div>
                    </form>
                    <div class="left seo-cho"><img src="images/yes.png" alt=""> <img src="images/no.png" alt=""></div>

                </div>
                <img src="images/xiugai.png" alt="">
            </div>
            <span class="x-right" style="line-height:40px">
            <!-- <button class="layui-btn  layui-btn-normal layui-btn-small  layui-btn-radius save">保存</button> -->
            共有数据：88 条</span>
            <div class="clear"></div>
        </xblock>


        <table class="layui-table" lay-filter="demo">
            <thead>
                <tr>

                    <th>网站名称</th>
                    <th>网址</th>
                    <th>今日收录</th>
                    <th>今日排名</th>
                    <th>优化人</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>百度</td>
                    <td>www.baidu.com</td>
                    <td class="sl"><input type="text" class="layui-input" placeholder="请输入" value="231"></td>
                    <td class="sl"><input type="text" class="layui-input" placeholder="请输入" value="231"></td>
                    <td>马蓉</td>

                    <td class="td-manage">
                        <a title="编辑" onclick="x_admin_show('修改渠道信息','./SEO-add.html',600,300)">
                            <i class="layui-icon">&#xe642;</i>
                        </a>
                        <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;">
                            <i class="layui-icon">&#xe640;</i>
                        </a>
                    </td>
                </tr>
            </tbody>
        </table>
        <div class="page">
            <div>
                <a class="prev" href="">&lt;&lt;</a>
                <a class="num" href="">1</a>
                <span class="current">2</span>
                <a class="num" href="">3</a>
                <a class="num" href="">99</a>
                <a class="next" href="">&gt;&gt;</a>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="./js/jquery-3.2.1.min.js"></script>
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>

    <script>
        $(function() {
            $(".sl input").attr("disabled", "disabled");
        })
        $(".sl").click(function() { //点击单元格输入
            console.log(343)
            $(this).children().removeAttr("disabled");

        })
        $(".sl input").blur(function() {
            console.log(2323)
            $(this).attr("disabled", "disabled");
            layer.msg('已保存!', {
                icon: 1,
                time: 2000
            });
        })
        $(".charge>img").click(function() { //负责人窗口切换
            $(this).hide();
            $(".charge>span").hide();
            $(".seo-q").show();
        })
        $(".seo-cho>img").click(function() {
            $(".charge>img").show();
            $(".charge>span").show();
            $(".seo-q").hide();
        })
    </script>
    <script>
        //    下拉框
        //监听。这是文档里的方法，平常js无法操作select
        layui.use(['layer', 'form'], function() {
            var layer = layui.layer,
                form = layui.form;
            form.on('select(province)', function(data) {
                //            console.log(data.elem); //得到select原始DOM对象
                //            console.log(data.value); //得到被选中的值
                var sec = data.value;
                var add; //联动select的数组
                if (sec == "22") {
                    add = new Array("wwww", "aaa");
                } else if (sec == "33") {
                    add = new Array("fasfaf", "fdgadgasdgs");
                } else if (sec == "44") {
                    add = new Array("陈达");
                } else if (sec == "55") {
                    add = new Array("dasdsadsadsfdg", "ukuykruk");
                } else if (sec == "66") {
                    add = new Array("资讯", "教育宝");
                }
                //联动效果的实现
                if (add != null) {
                    $("people").length = 0;
                    $("#people>option").remove();
                    for (var i = 0; i < add.length; i++) {
                        var ss = new Option();
                        ss.text = add[i].split()[0];
                        $("#people").append(ss);
                        //                    $("#yxDown").append(ss);
                        form.render('select');
                    }
                }
            });
        });

        function member_del(obj, id) {
            var data = $(obj).parent().parent().children().html();
            console.log(data)
            layer.confirm('确认要删除' + data + '吗？', {
                title: '确认删除'
            }, function(index) {
                //发异步删除数据
                $(obj).parents("tr").remove();
                layer.msg('已删除!', {
                    icon: 1,
                    time: 1000
                });
            });
        }
    </script>
    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
</body>

</html>